package com.xiemingtian.navdemo


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import kotlinx.android.synthetic.main.fragment_simple.*

class SimpleFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
                              savedInstanceState: Bundle?): View? {
        return inflater.inflate(R.layout.fragment_simple, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        jump.setOnClickListener {
            val host = SimpleFragment()
            requireFragmentManager().beginTransaction()
                    .setCustomAnimations(Util.navOpt.enterAnim,0,0,Util.navOpt.popExitAnim)
                    .add(R.id.container,host)
                    .addToBackStack(hashCode().toString())
                    .commit()
        }
    }


}
